import axios from 'axios'

export const getFileTypes = () => axios.get('/api/file/types')
export const preUpload = (formData) => axios.post('/api/file/upload-by-type/pre', formData)
export const confirmUpload = (payload) => axios.post('/api/file/upload-by-type/submit', payload)

export const getFileList = (params) => axios.get('/api/file/pageFile', { params })

export const deleteFile = (id) => axios.delete(`/api/file/remove?ids=${id}`)

export const getSegDataPage = (params) => axios.get('/api/fileChunk/getSegDataPage', { params })

export const recallTesting = (question) =>
  axios.get('/api/llm/recallTesting', { params: { question } })

export const stopLLMChat = (taskId) => axios.post(`/api/llm/stop/${taskId}`)

export const getHistoryPage = (params) => axios.get('/api/history/getHistoryPage', { params })
export const getHistoryConversationData = (params) =>
  axios.get('/api/history/getHistoryConversationData', { params })
export const updateHistoryTitle = (data) => axios.post('/api/history/update', data)
export const removeHistory = (id) => axios.post(`/api/history/remove?ids=${id}`)
